﻿<%@ Page Title="" Language="C#" MasterPageFile="~/master/Site.Master" AutoEventWireup="true"
	CodeBehind="UserManagement.aspx.cs" Inherits="Hematology.UserSite.admin.UserManagement" %>

<%@ Import Namespace="Hematology.Data" %>
<%@ Import Namespace="Hematology.Tools" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphHead" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphRecent" runat="server">
	<hmt:PageTitle runat="server" ID="ptTitle" Text='<%$ Resources:UserSite, resUserManagement %>'
		ButtonText='<%$ Resources:UserSite, resWhitespace %>' ButtonCssClass="import"
		ShowButton="True" TitleButtonType="Hyperlink" NavigateUrl="/admin/UserManagement.aspx?view=Import"
		ToolTip='<%$ Resources:UserSite, resImportUsers %>' />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphHeadNews" runat="server">
	<div class="userFullPageContainer">
		<asp:MultiView runat="server" ID="mvUserManagement">
			<asp:View runat="server" ID="vUserList">
				<div class="letterList">
					<asp:Repeater runat="server" ID="rptAlphabetLinks" OnItemCommand="rptAlphabetLinks_ItemCommand">
						<ItemTemplate>
							<asp:LinkButton runat="server" ID="btnLetter" Text='<%# Container.DataItem %>' CommandName="FilterByName"
								CommandArgument='<%# Container.DataItem %>' />
						</ItemTemplate>
					</asp:Repeater>
				</div>
				<asp:Repeater runat="server" ID="rptSiteUser" OnItemCommand="rptSiteUser_ItemCommand">
					<HeaderTemplate>
						<div class="adminTableContainer">
							<div class="adminTableBlock">
								<div class="adminTableRow adminTableRowHeader">
									<div class="adminTableRowIcon">
										&nbsp;
									</div>
									<div class="adminTableRowIcon">
										&nbsp;
									</div>
									<div class="adminTableRow150">
										<asp:Label ID="lUserNameHdr" runat="server" Text='<%$ Resources:UserSite, resLogin %>' />
									</div>
									<div class="adminTableRow200">
										<asp:Label ID="lUserMailHdr" runat="server" Text='<%$ Resources:UserSite, resEmail %>' />
									</div>
									<div class="adminTableRow150">
										<asp:Label ID="lUserRolesHdr" runat="server" Text='<%$ Resources:UserSite, resUserRoles %>' />
									</div>
									<div class="adminTableRowDate">
										<asp:Label ID="lUserCreatedDateHdr" runat="server" Text='<%$ Resources:UserSite, resDateCreated %>' />
									</div>
								</div>
					</HeaderTemplate>
					<ItemTemplate>
						<div class="adminTableRow">
							<div class="adminTableRowIcon">
								<asp:CheckBox runat="server" ID="cbSelectUser" />
							</div>
							<div class="adminTableRowIcon">
								<asp:LinkButton runat="server" ID="btnShowUserDetails" CssClass='<%# PageHelper.GetUserDetailsIconClass(Eval("BaseInfo.IsActivated")) %>' />
							</div>
							<div class="adminTableRow150">
								<asp:Label ID="lUserName" runat="server" Text='<%# PageHelper.GetCroppedUserName(Eval("FirstName"), Eval("MiddleName"), Eval("LastName")) %>' />
							</div>
							<div class="adminTableRow200">
								<asp:HyperLink runat="server" ID="hlUserEmail" Text='<%# Eval("BaseInfo.Email") %>'
									NavigateUrl='<%# PageHelper.FormatEmailString(Eval("FirstName"), Eval("MiddleName"), Eval("LastName"), Eval("BaseInfo.Email")) %>' />
							</div>
							<div class="adminTableRow150">
								<asp:Literal runat="server" ID="lWhiteSpace" Text='<%$ Resources:UserSite, resWhitespace %>' />
								<asp:Repeater runat="server" ID="rptUserRoles" DataSource='<%#((SiteUserExtended)Container.DataItem).BaseInfo.AccessRoles%>'>
									<ItemTemplate>
										<asp:Label ID="lRoleName" runat="server" Text='<%# Eval("Name") %>' />
									</ItemTemplate>
								</asp:Repeater>
							</div>
							<div class="adminTableRowDate">
								<asp:Label ID="lUserCreatedDate" runat="server" Text='<%# PageHelper.SetDateCellContent(Eval("BaseInfo.CreatedDate")) %>' />
							</div>
							<div class="adminTableRowIconBlock">
								<div class="adminTableRowIcon">
									<asp:LinkButton runat="server" ID="btnSetUserActivity" CssClass='<%# PageHelper.GetUserActivityIconClass(Eval("BaseInfo.IsActivated")) %>'
										ToolTip='<%# GetUserIconActivityToolTip(Eval("BaseInfo.IsActivated")) %>' CommandName="SetUserActivity"
										CommandArgument='<%# Eval("UserId") %>' OnClientClick='<%# PageHelper.GetConfirmProfileActionString(Container.DataItem, true) %>' />
								</div>
								<div class="adminTableRowIcon">
									<asp:LinkButton runat="server" ID="btnSetUserLock" CssClass='<%# PageHelper.GetUserLockIconClass(Eval("BaseInfo.IsLockedOut")) %>'
										ToolTip='<%# GetUserIconLockStateToolTip(Eval("BaseInfo.IsLockedOut")) %>' CommandName="SetUserLockState"
										CommandArgument='<%# Eval("UserId") %>' OnClientClick='<%# PageHelper.GetConfirmProfileActionString(Container.DataItem, false) %>' />
								</div>
								<div class="adminTableRowIcon">
									<asp:HyperLink ID="hlEditUser" runat="server" NavigateUrl='<%# string.Format("/admin/UserManagement.aspx?view=Edit&id={0}", Eval("UserId")) %>'
										ToolTip="Правка" CssClass="adminTableRowEdit" />
								</div>
								<div class="adminTableRowIcon">
									<asp:LinkButton ID="btnDeleteUser" runat="server" ToolTip='<%$ Resources:UserSite, resDelete %>'
										CommandName="DeleteUser" CommandArgument='<%# Eval("BaseInfo.Email") %>' OnClientClick='<%# PageHelper.GetDeleteProfileActionString(Container.DataItem) %>'
										CssClass="adminTableRowDelete" />
								</div>
							</div>
						</div>
						<asp:Panel runat="server" ID="pnlUserDetails" CssClass="adminTableRow adminTableRowDetails"
							Visible="False">
							<div class="adminTableRowDetailsRow">
								<asp:Label ID="lUserDetails" runat="server" Text='<%# GetUserDetails(Container.DataItem) %>' />
							</div>
						</asp:Panel>
					</ItemTemplate>
					<FooterTemplate>
						</div> </div>
						<div style="clear: both;">
						</div>
						<div class="userFullPageButtonWrapper">
							<asp:Button runat="server" ID="btnSendInvitationsToSelectedUsers" CommandName="SendInvitations"
								Text='<%$ Resources:UserSite, resSendInvitations %>' />
							<asp:Button runat="server" ID="btnSendFreeEmailToSelectedUsers" CommandName="SendFreeEmail"
								Text='<%$ Resources:UserSite, resCreateEmail %>' />
						</div>
					</FooterTemplate>
				</asp:Repeater>
			</asp:View>
			<asp:View runat="server" ID="vUserInfo">
				<div class="editorBlock">
					<div class="editorBlockEditControl">
						<div class="editorBlockTitle">
							<asp:Label runat="server" ID="lblEmail" Text='<%$ Resources:UserSite, resEmail %>' />
						</div>
						<div class="editorBlockControl">
							<asp:TextBox runat="server" ID="txtEmail" MaxLength="150" />
						</div>
					</div>
					<div class="editorBlockEditControl">
						<div class="editorBlockTitle">
							<asp:Label runat="server" ID="lblFirstName" Text='<%$ Resources:UserSite, resFirstName %>' />
						</div>
						<div class="editorBlockControl">
							<asp:TextBox runat="server" ID="txtFirstName" MaxLength="150" />
						</div>
					</div>
					<div class="editorBlockEditControl">
						<div class="editorBlockTitle">
							<asp:Label runat="server" ID="lblMiddleName" Text='<%$ Resources:UserSite, resMiddleName %>' />
						</div>
						<div class="editorBlockControl">
							<asp:TextBox runat="server" ID="txtMiddleName" MaxLength="150" />
						</div>
					</div>
					<div class="editorBlockEditControl">
						<div class="editorBlockTitle">
							<asp:Label runat="server" ID="lblLastName" Text='<%$ Resources:UserSite, resLastName %>' />
						</div>
						<div class="editorBlockControl">
							<asp:TextBox runat="server" ID="txtLastName" MaxLength="150" />
						</div>
					</div>
					<div class="editorBlockEditControl">
						<div class="editorBlockTitle">
							<asp:Label runat="server" ID="Label1" Text='<%$ Resources:UserSite, resRoles %>' />
						</div>
						<div class="editorBlockControl">
							<asp:Repeater runat="server" ID="rptUserRoles">
								<ItemTemplate>
									<asp:CheckBox runat="server" ID="cbRole" Text='<%# Eval("Name") %>' Checked='<%# GetRoleState(Eval("RoleId")) %>' />
								</ItemTemplate>
							</asp:Repeater>
						</div>
					</div>
					<div class="editorBlockButton">
						<asp:Button runat="server" ID="btnSaveUser" Text='<%$ Resources:UserSite, resSave %>'
							OnClick="btnSaveUser_Click" />
						<asp:Button runat="server" ID="btnList" Text='<%$ Resources:UserSite, resToList %>'
							OnClick="btnList_Click" />
					</div>
				</div>
			</asp:View>
			<asp:View runat="server" ID="vUserImport">
				<div class="editorBlock">
					<div class="editorDatePickerBlockControl">
						<div class="editorDatePickerTitle">
							<asp:Label ID="lblAttachFile" runat="server" Text='<%$ Resources:UserSite, resSelectImportFile %>' />
						</div>
						<div class="editorDatePicker">
							<asp:FileUpload runat="server" ID="fuSiteUser" />
						</div>
						<div class="editorDatePicker">
							<asp:Button runat="server" ID="btnImportUsers" Text='<%$ Resources:UserSite, resImport %>'
								OnClick="btnImportUsers_Click" />
						</div>
					</div>
					<div class="editorDatePickerBlockControl">
						<div class="editorDatePickerTitle">
							<asp:CheckBox runat="server" ID="chkSendUserNotice" Text='<%$ Resources:UserSite, resSendUserNotice %>' />
						</div>
					</div>
				</div>
			</asp:View>
		</asp:MultiView>
	</div>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="cphBody" runat="server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="cphPanel" runat="server">
</asp:Content>
